<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition>
			<p:dialog header="#{msgs.pleaseLogin}" id="loginDialog" widgetVar="loginDlg" modal="true"
				showEffect="explode" hideEffect="clip" width="380" height="250" >				
					<p:tabView effect="slide" effectDuration="2000"
						orientation="bottom">
						<p:tab title="#{msgs.email}">
							<h:panelGrid border="0" columns="2" style="width:100%">
								<h:outputLabel style="float:left" value="#{msgs.email}" />
								<p:inputText id="email" value="#{userModel.current.email}" style="width:100%;float:left;font-size:0.8em"/>
								<h:outputLabel value="#{msgs.password}" style="float:left;" />
								<p:password id="password" value="#{userModel.current.password}"
									feedback="false"  style="width:100%;float:left;font-size:0.8em" />
								<h:inputHidden />
								<p:commandButton value="#{msgs.login}"  ajax="true" update=":dialogForm"
									actionListener="#{userController.loginCurrentByEmail}"
									style="float:left;margin-top:10px" />
							</h:panelGrid>
						</p:tab>
						<p:tab title="#{msgs.telephone}">
							<h:panelGrid border="0" columns="2" style="width:100%">
								<h:outputLabel style="float:left" value="#{msgs.telephone}" />
								<p:inputMask id="telephone"
									value="#{userModel.current.telephone}" mask="(999)999-9999" style="width:100%;float:left;font-size:0.8em"/>
								<h:outputLabel value="#{msgs.password}" style="float:left;" />
								<p:password id="telephonePassword" feedback="false"
									value="#{userModel.current.confirmPassword}" style="width:100%;float:left;font-size:0.8em"/>
								<h:inputHidden />
								<p:commandButton value="#{msgs.login}"  ajax="true" update=":dialogForm"
									actionListener="#{userController.loginCurrentByTelephone}"
									style="float:left;margin-top:10px" />
							</h:panelGrid>
						</p:tab>
					</p:tabView>
					<h:panelGrid columns="2" style="width:100%;margin-top:10px">
						<h:commandLink value="#{msgs.notMember}" type="submit"
							style="float:left" immediate="true"
							action="/public/register.xhtml?faces-redirect=true" />
						<h:commandLink value="#{msgs.forgetPassword}" type="submit"
							style="float:left" immediate="true"
							action="/public/passwordRecover.xhtml?faces-redirect=true" />
					</h:panelGrid>
				
			</p:dialog>
		</ui:composition>
	</body>
</f:view>
</html>